Change in openvpn[master]: interactive.c: add the upper bound for startupdata size
A message that is not in the archive (sent off-list or not yet received): gerrit.1761813264000.I75ebf01641db4dcd07041e3b8b3fa8a632d07595@...2715...
Attention is currently required from: flichtenheld, plaisthos.
Hello plaisthos, flichtenheld,
I'd like you to do a code review.
Please visit
http://gerrit.openvpn.net/c/openvpn/+/1331?usp=email
to review the following change.
Change subject: interactive.c: add the upper bound for startupdata size
......................................................................
interactive.c: add the upper bound for startupdata size
The size is passed from the limited-privileges process. This check ensures that the service won't allocate more than needed.
---
M src/openvpnserv/interactive.c
1 file changed, 2 insertions(+), 2 deletions(-)
git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/31/1331/1
src/openvpnserv/interactive.c +2 -2
@@ -446,9 +446,9 @@ } size = bytes /sizeof (*data); -if (size ==0 ) +if ((size ==0 ) || (size >4096 ))/* our startup data is 1024 wchars at the moment */ { -MsgToEventLog (M_SYSERR ,L"malformed startup data: 1 byte received" ); +MsgToEventLog (M_SYSERR ,L"malformed startup data: %lu bytes received" , size);ReturnError (pipe,ERROR_STARTUP_DATA ,L"GetStartupData" ,1 , &exit_event); goto err; }
--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/1331?usp=email
To unsubscribe, or for help writing mail filters, visit http://gerrit.openvpn.net/settings?usp=email
Gerrit-MessageType: newchange
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I75ebf01641db4dcd07041e3b8b3fa8a632d07595
Gerrit-Change-Number: 1331
Gerrit-PatchSet: 1
Gerrit-Owner: stipa <[email protected]...>
Gerrit-Reviewer: flichtenheld <[email protected]...>
Gerrit-Reviewer: plaisthos <[email protected]...>
Gerrit-CC: openvpn-devel <[email protected]>
Gerrit-Attention: plaisthos <[email protected]...>
Gerrit-Attention: flichtenheld <[email protected]...>
Attention is currently required from: flichtenheld, plaisthos, stipa.
cron2 has posted comments on this change by stipa. ( http://gerrit.openvpn.net/c/openvpn/+/1331?usp=email )
Change subject: interactive.c: add the upper bound for startupdata size
......................................................................
Patch Set 1: Code-Review+2
--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/1331?usp=email
To unsubscribe, or for help writing mail filters, visit http://gerrit.openvpn.net/settings?usp=email
Gerrit-MessageType: comment
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I75ebf01641db4dcd07041e3b8b3fa8a632d07595
Gerrit-Change-Number: 1331
Gerrit-PatchSet: 1
Gerrit-Owner: stipa <[email protected]...>
Gerrit-Reviewer: cron2 <[email protected]...>
Gerrit-Reviewer: flichtenheld <[email protected]...>
Gerrit-Reviewer: plaisthos <[email protected]...>
Gerrit-CC: openvpn-devel <[email protected]>
Gerrit-Attention: plaisthos <[email protected]...>
Gerrit-Attention: flichtenheld <[email protected]...>
Gerrit-Attention: stipa <[email protected]...>
Gerrit-Comment-Date: Thu, 30 Oct 2025 15:04:19 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
PATCH 1/1 interactive.c: add the upper bound for startupdata size
In reply to a message not in the archiveFrom: Lev Stipakov <[email protected]...>
The size is passed from the limited-privileges process. This check ensures that the service won't allocate more than needed.
Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1331
---
This change was reviewed on Gerrit and approved by at least one developer. I request to merge it to master.
Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1331
This mail reflects revision 1 of this Change.
Acked-by according to Gerrit (reflected above):
Gert Doering <[email protected]...>
src/openvpnserv/interactive.c +2 -2
@@ -446,9 +446,9 @@ } size = bytes /sizeof (*data); -if (size ==0 ) +if ((size ==0 ) || (size >4096 ))/* our startup data is 1024 wchars at the moment */ { -MsgToEventLog (M_SYSERR ,L"malformed startup data: 1 byte received" ); +MsgToEventLog (M_SYSERR ,L"malformed startup data: %lu bytes received" , size);ReturnError (pipe,ERROR_STARTUP_DATA ,L"GetStartupData" ,1 , &exit_event); goto err; }
[Openvpn-devel] [PATCH applied] Re: interactive.c: add the upper bound for startupdata size
Looks good, reasonable hardening against unasked-for garbage coming in via the service pipe. Have not tested this, but since you have so nicely made event logging beautiful again, evidence should be clearly visible.
Your patch has been applied to the master branch.
commit 37af2c953266a3ffd34b3fa95317bd995e985aec
Author: Lev Stipakov Date: Thu Oct 30 16:04:26 2025 +0100
interactive.c: add the upper bound for startupdata size
Signed-off-by: Lev Stipakov <[email protected]...>
Acked-by: Gert Doering <[email protected]...>
Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1331
Message-Id: <[email protected]...>
URL: https://www.mail-archive.com/[email protected]/msg34039.html
Signed-off-by: Gert Doering <[email protected]...>--
kind regards,
Gert Doering
cron2 has uploaded a new patch set (#2) to the change originally created by stipa. ( http://gerrit.openvpn.net/c/openvpn/+/1331?usp=email )
The following approvals got outdated and were removed:
Code-Review+2 by cron2
Change subject: interactive.c: add the upper bound for startupdata size
......................................................................
interactive.c: add the upper bound for startupdata size
The size is passed from the limited-privileges process. This check ensures that the service won't allocate more than needed.
Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1331
Message-Id: <[email protected]...>
URL: https://www.mail-archive.com/[email protected]/msg34039.html
---
M src/openvpnserv/interactive.c
1 file changed, 2 insertions(+), 2 deletions(-)
git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/31/1331/2
src/openvpnserv/interactive.c +2 -2
@@ -446,9 +446,9 @@ } size = bytes /sizeof (*data); -if (size ==0 ) +if ((size ==0 ) || (size >4096 ))/* our startup data is 1024 wchars at the moment */ { -MsgToEventLog (M_SYSERR ,L"malformed startup data: 1 byte received" ); +MsgToEventLog (M_SYSERR ,L"malformed startup data: %lu bytes received" , size);ReturnError (pipe,ERROR_STARTUP_DATA ,L"GetStartupData" ,1 , &exit_event); goto err; }
--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/1331?usp=email
To unsubscribe, or for help writing mail filters, visit http://gerrit.openvpn.net/settings?usp=email
Gerrit-MessageType: newpatchset
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I75ebf01641db4dcd07041e3b8b3fa8a632d07595
Gerrit-Change-Number: 1331
Gerrit-PatchSet: 2
Gerrit-Owner: stipa <[email protected]...>
Gerrit-Reviewer: cron2 <[email protected]...>
Gerrit-Reviewer: flichtenheld <[email protected]...>
Gerrit-Reviewer: plaisthos <[email protected]...>
Gerrit-CC: openvpn-devel <[email protected]>
cron2 has submitted this change. ( http://gerrit.openvpn.net/c/openvpn/+/1331?usp=email )
Change subject: interactive.c: add the upper bound for startupdata size
......................................................................
interactive.c: add the upper bound for startupdata size
The size is passed from the limited-privileges process. This check ensures that the service won't allocate more than needed.
Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1331
Message-Id: <[email protected]...>
URL: https://www.mail-archive.com/[email protected]/msg34039.html
---
M src/openvpnserv/interactive.c
1 file changed, 2 insertions(+), 2 deletions(-)
src/openvpnserv/interactive.c +2 -2
@@ -446,9 +446,9 @@ } size = bytes /sizeof (*data); -if (size ==0 ) +if ((size ==0 ) || (size >4096 ))/* our startup data is 1024 wchars at the moment */ { -MsgToEventLog (M_SYSERR ,L"malformed startup data: 1 byte received" ); +MsgToEventLog (M_SYSERR ,L"malformed startup data: %lu bytes received" , size);ReturnError (pipe,ERROR_STARTUP_DATA ,L"GetStartupData" ,1 , &exit_event); goto err; }
--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/1331?usp=email
To unsubscribe, or for help writing mail filters, visit http://gerrit.openvpn.net/settings?usp=email
Gerrit-MessageType: merged
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I75ebf01641db4dcd07041e3b8b3fa8a632d07595
Gerrit-Change-Number: 1331
Gerrit-PatchSet: 2
Gerrit-Owner: stipa <[email protected]...>
Gerrit-Reviewer: cron2 <[email protected]...>
Gerrit-Reviewer: flichtenheld <[email protected]...>
Gerrit-Reviewer: plaisthos <[email protected]...>
Gerrit-CC: openvpn-devel <[email protected]>